<!-- 小程序二维码 -->
<div class="nav-qrocde-hover" style="display: none;">
    <div class="qrocde-info">
        <div class="qrcode">
            <img style="display: block;width: 150px;margin: 0 auto;" src="{:request()->pc_info['applet_qrcode']}">
        </div>
        <p style="text-align: center;font-size:14px;color:#999;margin-top: 15px;">扫码使用微信小程序</p>
    </div>
</div>

<!-- 客服信息 -->
<div class="service-hover" style="display: none;">
    {if request()->store_set['service_open'] == 1}
        {if request()->store_set['service_info']['work_weixin_default'] == 1}
            <div class="qrocde-info">
                <div class="qrcode">
                    <img style="display: block;width: 150px;margin: 0 auto;" src="{:request()->store_set['service_info']['work_weixin_qrocde'] ?? ''}">
                </div>
                <p style="text-align: center;font-size:14px;color:#999;margin-top: 15px;">使用微信APP扫码咨询</p>
            </div>
        {else}
            <div class="tel" style="color:#555;font-size: 16px;display: flex;align-items: center;">
                <i class="iconfont icon-phone margin-right-10"></i>{:request()->store_set['service_info']['tel'] ?? ''}
            </div>
        {/if}
    {/if}
</div>
<script type="text/javascript">
    layui.use(['jquery', 'layer', 'form'],function(){
        var util = layui.util, element = layui.element, $ = layui.jquery;

        // 右侧固定导航栏
        util.fixbar({
            bars: [{ // 定义可显示的 bar 列表信息 -- v2.8.0 新增
                type: 'refresh',
                icon: 'layui-icon-refresh',
                style: 'color: #555;background-color: #fff;margin-bottom: 10px;border-radius: 6px;font-size:24px;'
            }, { // 定义可显示的 bar 列表信息 -- v2.8.0 新增
                type: 'feedback',
                icon: 'layui-icon-survey',
                style: 'color: #555;background-color: #fff;margin-bottom: 10px;border-radius: 6px;font-size:26px;'
            }, {
                type: 'service',
                icon: 'layui-icon-service',
                style: 'color: #555;background-color: #fff;margin-bottom: 10px;border-radius: 6px;font-size:26px;'
            }, {
                type: 'applet-qrocde',
                icon: 'layui-icon-cellphone',
                style: 'color: #555;background-color: #fff;margin-bottom: 10px;border-radius: 6px;font-size:24px;'
            }, {
                type: 'top',
                icon: 'layui-icon-top',
                style: 'background-color: #16b777;border-radius: 6px;'
            }],
            default: false,
            css: {bottom: '30%'},
            on: { // 任意事件 --  v2.8.0 新增
                mouseenter: function(type){
                    if (type == 'applet-qrocde') {
                        layer.tips($(".nav-qrocde-hover").html(), this, {
                            tips: [4, '#fff'],
                            area: ['230px', 'auto'],
                            time: 300000,
                        });
                    } else if (type == 'service') {
                        layer.tips($(".service-hover").html(), this, {
                            tips: [4, '#fff'],
                            area: ['230px', 'auto'],
                            time: 300000,
                        });
                    }
                },
                mouseleave: function(type){
                    layer.closeAll('tips');
                }
            },
            // 点击事件
            click: function(type){
                if (type == 'feedback') {
                    var loading = layer.load();
                    var user_id = "{:session('user.id')}";
                    if (!user_id) {
                        open_login();
                    } else {
                        location.href='/user/feedback';
                    }
                    layer.close(loading);
                } else if (type == 'refresh') {
                    var loading = layer.load();
                    location.reload();
                }
            }
        });
    });
</script>